package com.example.backend.common.listener;

import com.example.backend.service.InitService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

/**
 * 系统初始化监听器
 */
@Slf4j
@Component
@RequiredArgsConstructor
public class SystemInitListener implements ApplicationListener<ApplicationReadyEvent> {
    
    private final InitService initService;
    
    @Override
    public void onApplicationEvent(ApplicationReadyEvent event) {
        log.info("开始系统初始化...");
        initService.init();
    }
} 